/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.utfpr.bean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author guardezi
 */
@Entity
@Table(name = "TB_CLIENTE")
public class Cliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CLI_CPF")
    private Long cliCpf;
    @Column(name = "CLI_RG")
    private String cliRg;
    @Column(name = "CLI_NOME")
    private String cliNome;
    @Column(name = "CLI_FONE")
    private String cliFone;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tbClienteCliCpf")
    private List<Poltrona> poltronaList;

    public Cliente() {
    }

    public Cliente(Long cliCpf) {
        this.cliCpf = cliCpf;
    }

    public Long getCliCpf() {
        return cliCpf;
    }

    public void setCliCpf(Long cliCpf) {
        this.cliCpf = cliCpf;
    }

    public String getCliRg() {
        return cliRg;
    }

    public void setCliRg(String cliRg) {
        this.cliRg = cliRg;
    }

    public String getCliNome() {
        return cliNome;
    }

    public void setCliNome(String cliNome) {
        this.cliNome = cliNome;
    }

    public String getCliFone() {
        return cliFone;
    }

    public void setCliFone(String cliFone) {
        this.cliFone = cliFone;
    }

    @XmlTransient
    public List<Poltrona> getPoltronaList() {
        return poltronaList;
    }

    public void setPoltronaList(List<Poltrona> poltronaList) {
        this.poltronaList = poltronaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cliCpf != null ? cliCpf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.cliCpf == null && other.cliCpf != null) || (this.cliCpf != null && !this.cliCpf.equals(other.cliCpf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.edu.utfpr.bean.Cliente[ cliCpf=" + cliCpf + " ]";
    }
    
}
